﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QuanLiGiaiBongDa
{
    public partial class frmDangNhap : Form
    {
        public frmDangNhap()
        {
            InitializeComponent();
        }
        private void frmDangNhap_Load(object sender, EventArgs e)
        {
        }

        private void btthoat_Click(object sender, EventArgs e)
        {
            if (txtuser.Text == "")
                Application.Exit();
            else
                this.Close();
        }

        private void btdangnhap_Click(object sender, EventArgs e)
        {
            User db = new User();
            if (db.CheckLogin(txtuser.Text, txtPass.Text))
            {
                
                frmGiaoDien obj = new frmGiaoDien();
                obj.EnableMenu();
                this.Close();

            }
            else
                MessageBox.Show("Đăng nhập thất bại", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
        }

        private void frmDangNhap_FormClosing(object sender, FormClosingEventArgs e)
        {   
        }
    }
}
